#include <stl/set.h>
#include <standard/math.h>
#include "addscenedecorationcmd.h"
#include "editorscenemgr.h"
#include "sceneobjects/sceneobjectmanager.h"



CAddSceneDecorationCmd::CAddSceneDecorationCmd( const char* strFileName, float x, float y, float z, int32 nGridX, int32 nGridY, int32 nBrushSize, int32 nBrushType ){
    strncpy( m_strFileName, strFileName, 64);
    m_nBrushSize = nBrushSize;
    m_nBrushType = nBrushType;
    m_fX = x;
    m_fY = y;
    m_fZ = z;
    m_nGridX = nGridX;
    m_nGridY = nGridY;
}
CAddSceneDecorationCmd::~CAddSceneDecorationCmd(){

}
void CAddSceneDecorationCmd::Init(){
    Vector3 _vPosition = { m_fX, m_fY, m_fZ };
    Vector3 _vRotation = { 0.0f, 0.0f, 0.0f };
    CSceneObjectManager* _pSceneObjectManager = m_pSceneMgr->GetSceneObjectMgr();
    m_nObjectID = _pSceneObjectManager->AddSceneDecoration( 0u, m_strFileName, _vPosition, _vRotation, 1.0f );
}
void CAddSceneDecorationCmd::Final(){

}
bool32 CAddSceneDecorationCmd::Redo(){
    Vector3 _vPosition = { m_fX, m_fY, m_fZ };
    Vector3 _vRotation = { 0.0f, 0.0f, 0.0f };
    CSceneObjectManager* _pSceneObjectManager = m_pSceneMgr->GetSceneObjectMgr();
    m_nObjectID = _pSceneObjectManager->AddSceneDecoration( m_nObjectID, m_strFileName, _vPosition, _vRotation, 1.0f );
    return True;
}
bool32 CAddSceneDecorationCmd::Undo(){
    CSceneObjectManager* _pSceneObjectManager = m_pSceneMgr->GetSceneObjectMgr();
    _pSceneObjectManager->RemoveSceneDecoration( m_nObjectID );
    return True;
}
